import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
 {
   path:'/',
   redirect:'/home'
 },
 {
   path:'/home',
   component:()=>import('@/views/home.vue'),
   children:[
     {
       path:'index',
       component:()=>import('@/pages/index.vue'),
     },
     {
      path:'commodity',
      component:()=>import('@/views/commodity.vue'),
    },
     {
      path:'ification',
      component:()=>import('@/pages/ification.vue'),
    },
    {
      path:'shopcar',
      component:()=>import('@/pages/shopcar.vue'),
    },
    {
      path:'my',
      component:()=>import('@/pages/my.vue'),
    },
    {
      path:'order',
      component:()=>import('@/pages/order.vue'),
      // children:[
      //   {
      //     path:'myorder',
      //     component:()=>import('@/components/myorder.vue')
      //   }
      // ]
    },
    {
      path:'collection',
      component:()=>import('@/pages/collection.vue')
    },
    {
      path:'address',
      component:()=>import('@/pages/address.vue')
    },
    {
      path:'search',
      component:()=>import('@/pages/search.vue'),
    },
    {
      path:'type',
      component:()=>import('@/pages/type.vue'),
    }
   ]
 },
 {
    path:'/login',
    component:()=>import('@/views/login.vue'),
  },  
     {
      path:'/settlement',
      component:()=>import('@/views/settlement.vue'),
    },  
    {
     path:'/add',
     component:()=>import('@/pages/add.vue'),
   }
]
const router = new VueRouter({
  routes
})

export default router